/**
 * Displays a list of legislators
 */
Ext
		.define(
				'Lia.view.List',
				{
					extend : 'Ext.dataview.List',
					id : 'list',
					xtype : 'list',
					config : {
						ui : 'round',
						plugins : [
								{
									xclass : 'Ext.plugin.ListPaging',
									loadMoreText : 'Pr&#243;ximos...',
									autoPaging : true
								},
								{
									xclass : 'Ext.plugin.PullRefresh',
									pullRefreshText : 'Recargar Consulta...',
									releaseRefreshText : 'Soltar para Actualizar...',
									loadingText : 'Cargando...',
									itemId : 'pullRefreshCar',
									id : 'pullRefreshCar',
									refreshFn : function(plugin) {
										Ext.getStore('StoreCar').currentPage = 1;
										Ext.getStore('StoreCar').on('load',
												plugin.processComplete, plugin,
												{
													single : true
												});
										// this.parent._store.removeAll();

										Ext.getStore('StoreCar').load({
											start : 0,
											limit : 10,
											page : 1
										});
									},
									pullTpl : new Ext.XTemplate(
											'<div class="x-list-pullrefresh">',
											'<div class="x-list-pullrefresh-arrow"></div>',
											Ext.LoadingSpinner,
											'<div class="x-list-pullrefresh-wrap">',
											'<h3 class="x-list-pullrefresh-message">{message}</h3>',
											'<div class="x-list-pullrefresh-updated">Ultima Actualizaci&#243;n: <span>{lastUpdated:date("d/m/Y h:iA")}</span></div>',
											'</div>', '</div>')
								} ],

						pinHeaders : true,
						onItemDisclosure : true,
						itemTpl : '<div class="contact">{modelo} <strong>${precioFormat}</strong> {color}</div>',
						store : 'StoreCar',
						id : "carsListss",
						grouped : true,
						emptyText : '<div style="margin-top: 20px; text-align: center">No tiene elementos</div>',
						disableSelection : false,
						items : [ {
							xtype : 'toolbar',
							docked : 'top',

							items : [ 
							  {
								xtype : 'searchfield',
								 width:'50%',
								placeHolder : 'Buscar...',
								id : 'searchBtn'
							}, {
								xtype : 'spacer'
							} ,
							 {
								xtype : 'button',
								text : 'Agregar',
								id : 'addCar',
								ui : 'confirm'
							}]
						}],
					}
				});
